package com.apes.autoparts.parts.model;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import java.util.Date;

/***
 * 子组图片热点
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = SubGroupImgPoint.CONST_TABLE_NAME)
public class SubGroupImgPoint extends BaseModel {

    public static final String CONST_TABLE_NAME = "auto_sub_group_img_point";


    @Id
    @Column(name = "id")
    @ApesGenerator(code = CONST_TABLE_NAME, name = "子组图片热点图")
    @Comment("唯一码")
    private String id;


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "sub_group_img", referencedColumnName = "id")
    @Comment("子组")
    private SubGroupImg subGroupImg;

    @Column(name = "sn")
    @Comment("图号")
    private String sn;

    @Column(name = "x")
    @Comment("x轴")
    private String x;

    @Column(name = "y")
    @Comment("y轴")
    private String y;

    @Column(name = "w")
    @Comment("宽度")
    private String w;

    @Column(name = "h")
    @Comment("高度")
    private String h;

    @Column(name = "timestamp")
    @Comment("时间戳")
    private Date timestamp;

}
